package y23.Jun;

import java.util.Random;
import java.util.Scanner;

//完成猜数字游戏
public class Test9 {
    public static void main(String[] args) {
        Random random = new Random();
        int num = random.nextInt(100);
        Scanner sc = new Scanner(System.in);
        int i = 0;
        while(sc.hasNext()){
            int n = sc.nextInt();
            if(n == num){
                System.out.println("恭喜你，猜对了");
                break;
            } else if (n < num) {
                System.out.println("很抱歉，你猜小了");
            }else {
                System.out.println("很抱歉，你猜大了");
            }
            i++;
        }
        System.out.println("你猜了" + i + "次");
    }
}
